int Invert(char* str) {
    int num = 0;
    while ( *str != '\0')
    {
        int temp = *str - 48;
        num = num*10 + temp;
        str = str++;
    }
    return num;    
}